import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  // {
  //   path: '/',
  //   name: 'Home',
  //   component: Home
  // },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/login')
  },
  {
    path: '/change',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/change')
  },
  {
    path: '/index',
    name: 'index',
    component: () => import('../views/index.vue'),
    children: [
      {
        path: '/goodsB',
        component: () => import('../views/page/goodsB.vue'),
        meta: { title: '商品添加页' }
      },
      {
        path: '/goodsA/:id',
        component: () => import('../views/page/goodsA.vue'),
        meta: { title: '商品详情页' }
      },
      {
        path: '/goods',
        component: () => import('../views/page/goods.vue'),
        meta: { title: '商品编辑页' }
      },
      {
        path: '/dashboard',
        component: () => import('../views/page/Dashboard.vue'),
        meta: { title: '系统首页' }
      },
      {
        path: '/icon',
        component: () => import('../views/page/Icon.vue'),
        meta: { title: '自定义图标' }
      },
      {
        path: '/table',
        component: () => import('../views/page/Table.vue'),
        meta: { title: '基础表格' }
      },
      {
        path: '/tabs',
        component: () => import('../views/page/Tabs.vue'),
        meta: { title: 'tab选项卡' }
      },
      {
        path: '/form',
        component: () => import('../views/page/Form.vue'),
        meta: { title: '基本表单' }
      }, {
        path: '/editor',
        component: () => import('../views/page/Editor.vue'),
        meta: { title: '文本编辑器' }
      },
      {
        path: '/markdown',
        component: () => import('../views/page/Markdown.vue'),
        meta: { title: '编辑器' }
      },
      {
        path: '/upload',
        component: () => import('../views/page/Upload.vue'),
        meta: { title: '文件上传' }
      },
      {
        path: '/charts',
        component: () => import('../views/page/Charts.vue'),
        meta: { title: 'schart图表' }
      },
      {
        path: '/drag',
        component: () => import('../views/page/Drag.vue'),
        meta: { title: '拖拽列表' }
      },
      {
        path: '/dialog',
        component: () => import('../views/page/Dialog.vue'),
        meta: { title: '拖拽弹框' }
      },
      {
        path: '/i18n',
        component: () => import('../views/page/I18n.vue'),
        meta: { title: '国际化' }
      },
      {
        path: '/permission',
        component: () => import('../views/page/Permission.vue'),
        meta: { title: '权限' }
      },
      {
        path: '/404',
        component: () => import('../views/page/404.vue'),
        meta: { title: '404' }
      },
      {
        path: '/403',
        component: () => import('../views/page/403.vue'),
        meta: { title: '403' }
      },
      {
        path: '/donate',
        component: () => import('../views/page/Donate.vue'),
        meta: { title: '用户' }
      },
    ]
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
